package com.itheima.reggie.converter;

import com.alibaba.excel.converters.Converter;
import com.alibaba.excel.enums.CellDataTypeEnum;
import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.GlobalConfiguration;
import com.alibaba.excel.metadata.property.ExcelContentProperty;

public class IntegerStatusConverter implements Converter<Integer> {

	@Override
	public Class<Integer> supportJavaTypeKey() {
		return null;
	}

	@Override
	public CellDataTypeEnum supportExcelTypeKey() {
		return null;
	}

	@Override
	public Integer convertToJavaData(CellData cellData, ExcelContentProperty contentProperty,
										   GlobalConfiguration globalConfiguration) {
		return null;
	}

	@Override
	public CellData<Integer> convertToExcelData(Integer value, ExcelContentProperty contentProperty,
	                                           GlobalConfiguration globalConfiguration) {
		if (value.equals(1)){
			return new CellData("启用");
		}else {
			return new CellData("禁用");
		}
	}

}
